package com.imooc.sso.client;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 6.11.9 创建client1启动类
 * @author qilongfei
 */
@SpringBootApplication
@RestController // 6.11.3
/**
 * 6.11.11 添加sso支持
 */
@EnableOAuth2Sso
public class SsoClient2Application {
	
	/**
	 * 6.11.10 获取用户信息控制器
	 */
	@GetMapping("/user")
	public Authentication user(Authentication user){
		return user;
	}
	
	public static void main(String[] args) {
		SpringApplication.run(SsoClient2Application.class, args);
	}
}
